import { sm2, sm3 } from 'sm-crypto'
import { getEnvConfig } from '../config/index'
const PUBLIC_KEY = getEnvConfig().encodeLoginPwdPublicKey

export function encodePwd (pwd) {
  const doEncryPassword = sm3(pwd)
  const res = '04' + sm2.doEncrypt(doEncryPassword, PUBLIC_KEY, 1)
  return res
}